import Vue from "vue";
import Router from "vue-router";
// 登录
import login from "@/views/login";
// 首页
import index from "@/views/index";
/**
 * 基础菜单
 */
// 数据管理
import raster from "@/views/datasets/raster";
import terrain from "@/views/datasets/terrain";
import service from "@/views/services/service";
import algorithm from "@/views/algorithms/algorithm";
import AlgConfig from "@/views/algorithms/AlgConfig";
import tmpl from "@/views/tmpls/tmpl";
import report from "@/views/reports/report";
import ReportView from "@/views/reports/ReportView";
import NewReport from "@/views/NewReport/NewReport";
import user from "@/views/users/user";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: "/login",
      name: "登录",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: "/index",
      name: "首页",
      component: index,
      iconCls: "el-icon-tickets",
      children: [
        {
          path: "/rasters",
          name: "影像数据",
          component: raster,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/terrains",
          name: "地形数据",
          component: terrain,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/services",
          name: "服务管理",
          component: service,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/algorithms",
          name: "算法管理",
          component: algorithm,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/AlgConfig",
          name: "算法新增",
          component: AlgConfig,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/tmpls",
          name: "模板管理",
          component: tmpl,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/reports",
          name: "报告管理",
          component: report,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/NewReport",
          name: "报告新增",
          component: NewReport,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/ReportView",
          name: "查看报告",
          component: ReportView,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/users",
          name: "用户管理",
          component: user,
          meta: {
            requireAuth: true
          }
        }
      ]
    }
  ]
});
